Deploying Your Python uWSGI Application
In this article we will show you how to deploy your Django project with uWSGI onto our cloud platform. Currently, we support Python 3.6 and uWSGI 2.0.19.
Precondition:
Shell/SSH has been enabled in the Control Panel;
FTPS server has been enabled in the Control Panel;
An FTP client like FileZilla client has been installed on your local PC;
There should be a Django project on your local PC.
The application Url must be set to "http://*:8080"
1. Transfer your Django project files to Cloud Clusters platform
Remove the default Python demo project files before uploading.
In this case, we have already deployed a Python demo project files under /cloudclusters/default_site. Before you upload your own Django project files into cloud. Please delete all files under the default_site directory via Shell/SSH.
Open Shell/SSH, then run "rm ./* -rf" under /cloudclusters/default_site directory to remove files.
cd /cloudclusters/default_site
rm ./* -rf
Transfer your Django core project files into default_site folder.
Please refer to Transferring Data via FTPS to upload your Django project files to Cloud Clusters platform.
After deleting the Python demo project files. Then start to transfer files via FTP. At the left side of FileZilla client, go into your Django project home directory.
Select all files then click "Upload".
Transfer all Django project files into the default_site folder.
Install env
use the command /cloudclusters/venv3.6/bin/pip
to install Django
2. Change uWSGI config file for your Django project
Change wsgi-file to your project entry file in uwsgi.ini
Open Shell/SSH and modify uwsgi.ini by executing commands below.
cd /cloudclusters/config
vim uwsgi.ini
Note: Unless necessary, it is best not to modify other configuration items.
3. Publish your Django project again
Start the Django application by executing the command below:
supervisorctl restart uwsgi
View your Djando application in browser
Find the default domain name on the Site & SSL page.
Check if your Django application works.
Submit a ticket if you have difficulty in running your Django application.